home *** CD-ROM | disk | FTP | other *** search
- head 1.4;
- branch ;
- access ;
- symbols ;
- locks ; strict;
- comment @ * @;
-
-
- 1.4
- date 92.03.28.17.32.44; author kupfer; state Exp;
- branches ;
- next 1.3;
-
- 1.3
- date 92.03.05.21.38.38; author rab; state Exp;
- branches ;
- next 1.2;
-
- 1.2
- date 90.06.28.15.35.42; author rab; state Exp;
- branches ;
- next 1.1;
-
- 1.1
- date 90.03.21.23.18.06; author rab; state Exp;
- branches ;
- next ;
-
-
- desc
- @@
-
-
- 1.4
- log
- @Fix to allow both a long file name and a long link name. Lint.
- @
- text
- @/*
- * sprite.c --
- * Sprite dependent routines to make named pipes, pseudo devices, etc.
- */
-
- #include <stdio.h>
- #include <errno.h>
- #include <sys/types.h>
- #include <sys/stat.h>
-
- #include "sprite.h"
- #include "status.h"
- #include "fs.h"
- #include "tar.h"
-
- /*
- * SpriteMakeNamedPipe --
- * Create a named pipe under Sprite. This uses the name from the
- * tar record header, and the read-write-execute bits from the
- * mode of the file. This assumes that the tar tape was made
- * under Sprite, or that the UNIX read-write-execute bits are
- * the same as Sprite's, which is indeed the case.
- */
- int
- SpriteMakeNamedPipe(name, hstat)
- char *name;
- struct stat *hstat;
- {
- ReturnStatus status;
- int streamID;
- int flags;
-
- if (f_keep) {
- flags = FS_CREATE|FS_NAMED_PIPE_OPEN|FS_EXCLUSIVE;
- } else {
- flags = FS_CREATE|FS_NAMED_PIPE_OPEN;
- }
-
- status = Fs_Open(name, flags, hstat->st_mode & 0777, &streamID);
- if (status == SUCCESS) {
- (void)Fs_Close(streamID);
- return(0);
- } else {
- /*
- * Let our caller deal with errors. It may need to make
- * parent directories, etc.
- */
- errno = Compat_MapCode(status);
- return(-1);
- }
- }
-
- /*
- * SpriteMakePseudoDev --
- * Create a pseudo device under Sprite. This uses the name from the
- * tar record header, and the read-write-execute bits from the
- * mode of the file. This assumes that the tar tape was made
- * under Sprite, or that the UNIX read-write-execute bits are
- * the same as Sprite's, which is indeed the case.
- */
- int
- SpriteMakePseudoDev(name, hstat)
- char *name;
- struct stat *hstat;
- {
- ReturnStatus status;
- int streamID;
- int flags;
-
- if (f_keep) {
- flags = FS_CREATE|FS_PDEV_MASTER|FS_EXCLUSIVE;
- } else {
- flags = FS_CREATE|FS_PDEV_MASTER;
- }
-
- status = Fs_Open(name, flags, hstat->st_mode & 0777, &streamID);
- if (status == SUCCESS) {
- (void)Fs_Close(streamID);
- return(0);
- } else {
- /*
- * Let our caller deal with errors. It may need to make
- * parent directories, etc.
- */
- errno = Compat_MapCode(status);
- return(-1);
- }
- }
-
- /*
- * SpriteMakeRemoteLink --
- * Create a remote link under Sprite. This uses the name from the
- * tar record header, and the read-write-execute bits from the
- * mode of the file. This assumes that the tar tape was made
- * under Sprite, or that the UNIX read-write-execute bits are
- * the same as Sprite's, which is indeed the case.
- */
- int
- SpriteMakeRemoteLink(linkname, name)
- char *linkname; /* Name referred to by link */
- char *name; /* Name of file created */
- {
- ReturnStatus status;
-
- status = Fs_SymLink(linkname, name, TRUE);
- if (status == SUCCESS) {
- return(0);
- } else {
- /*
- * Let our caller deal with errors. It may need to make
- * parent directories, etc.
- */
- errno = Compat_MapCode(status);
- return(-1);
- }
- }
-
- @
-
-
- 1.3
- log
- @Lint (Mike checking in for Bob).
- @
- text
- @d7 1
- a13 1
- #include "compat.h"
- d25 2
- a26 2
- SpriteMakeNamedPipe(header, hstat)
- union record *header;
- d39 1
- a39 2
- status = Fs_Open(header->header.name, flags, hstat->st_mode & 0777,
- &streamID);
- d62 2
- a63 2
- SpriteMakePseudoDev(header, hstat)
- union record *header;
- d76 1
- a76 2
- status = Fs_Open(header->header.name, flags, hstat->st_mode & 0777,
- &streamID);
- a103 1
- int streamID;
- @
-
-
- 1.2
- log
- @Added support for long filenames and long symbolic linkes.
- @
- text
- @d25 2
- a26 2
- SpriteMakeNamedPipe(head, hstat)
- union record *head;
- d39 1
- a39 1
- status = Fs_Open(head->header.name, flags, hstat->st_mode & 0777,
- d63 2
- a64 2
- SpriteMakePseudoDev(head, hstat)
- union record *head;
- d77 1
- a77 1
- status = Fs_Open(head->header.name, flags, hstat->st_mode & 0777,
- @
-
-
- 1.1
- log
- @Initial revision
- @
- text
- @a15 3
- TAR_EXTERN char f_keep;
- TAR_EXTERN int errno;
-
- @
-